Repository navigation
feat(id): hosted import ingest — apply a verified export under normal admission rules (#13158) - #13201
Merged
Conversation
… admission rules (#13158) Slice 4b (ingest half) of #2852, remainder of #3810: §6.2 step 4. New `pkgs/id/src/hosted_ingest.rs`: `ingest_import` applies a `HostedExport` at the importing node, downstream of `verify_import` only — the `VerifiedImport` token must name the export's binding, key, and counts or nothing is written. - Objects go through the event store's normal ingest (`EventStore::ingest`): the same verification, fork, and waiting rules any peer's event faces, so a hosted-origin object is indistinguishable from a self-hosted one once stored. Objects held as waiting are settled after the whole export has been offered; one still waiting is reported refused under the waiting rule. - Blobs are placed in the node's iroh-blobs store under the BLAKE3 hash of their bytes — the hash a `document.put` header cites — so citations resolve locally. - The returned `ImportReport` names every object and blob as applied, already-present, or refused with the rule that refused it; a refusal never blocks the remaining entries. Tests (the issue's acceptance): round-trip store → export → verify → ingest lands every object byte-identical and the blob retrievable by its cited hash; re-ingest reports everything already-present; a wrapper-valid object that is not an event is refused as malformed, named, and does not block the rest; an object missing its predecessor is refused as waiting; a token minted for another export is refused before any write. `cargo test -p id --lib`: 531 passed, 0 failed (5 new). Clippy clean; rustfmt clean on the new file. hosted_export's module doc now points at the new module for step 4.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 34 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #13158 (slice 4b ingest half of #2852, remainder of #3810 — §6.2 step 4).
What
New
pkgs/id/src/hosted_ingest.rs:ingest_importapplies a verified hosted export at the importing (self-hosted) node.VerifiedImporttoken minted byverify_importmust be handed in and must name this export's binding, key, and entry counts; a mismatched token is refused (ImportError::VerificationMismatch) before anything is written.EventStore::ingest— the same verification, fork, and waiting rules any peer's event faces (id: investigate: trust/visibility model — servers accept all signed objects; views count only allowed writers #2030: validity at ingest, counting at view). Objects held as waiting are settled after the whole export has been offered; one still waiting is reported refused under the waiting rule (the store keeps its held row, so a later import carrying the dependency releases it).document.putheader cites — so citations resolve locally.ImportReportnames every object and blob as applied, already-present, or refused with the rule that refused it. A refusal never blocks the remaining entries; nothing is silently dropped.hosted_export's module doc now points at the new module for step 4.Verification (laptop,
nix developin pkgs/id)cargo test -p id --lib hosted_→ 57 passed, 0 failed (5 new ingest tests + the existing binding/export suites).cargo test -p id --lib(full) → 531 passed, 0 failed — no regressions.cargo clippy -p id --lib→ clean;rustfmt --checkon the new file → clean.New tests map to the issue's acceptance: round-trip store → export → verify → ingest lands every object byte-identical with the blob retrievable by its cited hash; re-ingest reports everything already-present; a wrapper-valid object that is not an event is refused as malformed, named, and does not block the rest; an object missing its predecessor is refused as waiting; a token for another export writes nothing.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.